<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link  rel="stylesheet" href="css/userInfo.css">
    <script  src="js/jquery-3.4.1.js" type="text/javascript"></script>
    <script src="js/jquery.validate.js" type="application/javascript"></script>
    <script src="js/jquery.validate.regex.js" type="application/javascript"></script>
    <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>
    <title>个人资料</title>
    <script>
        $(function () {
            var userId =  $.cookie('userId');
           // var userId =1;
            $.ajax({
                url:"/showUserInfo",
                type:"post",
                data:{
                    "userId":userId
                },
                dataType:"json",
                success:function (data) {
                    $("span[class='userRickname']").text(data.userRickname);
                    $("span[class='userName']").text(data.userName);
                    $("span[class='userSex']").text(data.userSex);

                    var phone=data.userPhone;
                    var dh=phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
                    $("span[class='userPhone']").text(dh);

                    var str=data.userBirthday;
                    if(str!=null){
                        var  sttr=str.substring(0,10);
                        $("span[class='userBirthday']").text(sttr);
                    }else {
                        $("span[class='userBirthday']").text("未设置");
                    }
                    $("span[class='userAddress']").text(data.userAddress);
                    $("span[class='userSign']").text(data.userSign);
                }

            });
        })
    </script>
</head>
<body>
    <div class="middle_content content_grzl content_content">
        <span class="middle_content_title">个人资料</span>
        <div class="grzl_msg">游侠昵称：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span class="userRickname">未设置</span>
        </div>
        <div class="grzl_msg">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span class="userName">未设置</span><span class="sp">方便对您称呼</span>
        </div>
        <div class="grzl_msg">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span class="userSex">未设置</span>
        </div>
        <div class="grzl_msg">手&nbsp;机&nbsp;号&nbsp;码：
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span class="userPhone">未设置</span>
        </div>
        <div class="grzl_msg">出生日期：
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span class="userBirthday">未设置</span><span class="sp">收获生日惊喜</span>
        </div>
        <div class="grzl_msg">常&nbsp;驻&nbsp;&nbsp;地：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span class="userAddress">未设置</span>
        </div>
        <div class="grzl_msg grzl_must">个性签名：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span class="userSign">未设置</span>
        </div>
        <a href="upUserInfo.html" id="grzl_edit">编辑</a>
    </div>
</body>
</html>